<?php
require_once('MainModel.php');

/**
 * Add your description here
 *
 * @author Anh euro
 * @copyright Hipt Group
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */
 
class Vina_Model_Categories extends MainModel
{

    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_Id;
    
    /**
     * mysql var type varchar(150)
     *
     * @var string     
     */
    protected $_Name;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameEn;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameChina;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_CategoryId;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameTitle;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameKey;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameDesc;
    
    /**
     * mysql var type tinyint(1)
     *
     * @var int     
     */
    protected $_Order;
    

    

function __construct() {
    $this->setColumnsList(array(
    'id'=>'Id',
    'name'=>'Name',
    'name_en'=>'NameEn',
    'name_china'=>'NameChina',
    'category_id'=>'CategoryId',
    'name_title'=>'NameTitle',
    'name_key'=>'NameKey',
    'name_desc'=>'NameDesc',
    'order'=>'Order',
    ));
}

	
    
    /**
     * sets column id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setId($data)
    {
        $this->_Id=$data;
        return $this;
    }

    /**
     * gets column id type int(11)
     * @return int     
     */
     
    public function getId()
    {
        return $this->_Id;
    }
    
    /**
     * sets column name type varchar(150)     
     *
     * @param string $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setName($data)
    {
        $this->_Name=$data;
        return $this;
    }

    /**
     * gets column name type varchar(150)
     * @return string     
     */
     
    public function getName()
    {
        return $this->_Name;
    }
    
    /**
     * sets column name_en type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setNameEn($data)
    {
        $this->_NameEn=$data;
        return $this;
    }

    /**
     * gets column name_en type varchar(255)
     * @return string     
     */
     
    public function getNameEn()
    {
        return $this->_NameEn;
    }
    
    /**
     * sets column name_china type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setNameChina($data)
    {
        $this->_NameChina=$data;
        return $this;
    }

    /**
     * gets column name_china type varchar(255)
     * @return string     
     */
     
    public function getNameChina()
    {
        return $this->_NameChina;
    }
    
    /**
     * sets column category_id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setCategoryId($data)
    {
        $this->_CategoryId=$data;
        return $this;
    }

    /**
     * gets column category_id type int(11)
     * @return int     
     */
     
    public function getCategoryId()
    {
        return $this->_CategoryId;
    }
    
    /**
     * sets column name_title type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setNameTitle($data)
    {
        $this->_NameTitle=$data;
        return $this;
    }

    /**
     * gets column name_title type varchar(255)
     * @return string     
     */
     
    public function getNameTitle()
    {
        return $this->_NameTitle;
    }
    
    /**
     * sets column name_key type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setNameKey($data)
    {
        $this->_NameKey=$data;
        return $this;
    }

    /**
     * gets column name_key type varchar(255)
     * @return string     
     */
     
    public function getNameKey()
    {
        return $this->_NameKey;
    }
    
    /**
     * sets column name_desc type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setNameDesc($data)
    {
        $this->_NameDesc=$data;
        return $this;
    }

    /**
     * gets column name_desc type varchar(255)
     * @return string     
     */
     
    public function getNameDesc()
    {
        return $this->_NameDesc;
    }
    
    /**
     * sets column order type tinyint(1)     
     *
     * @param int $data
     * @return Vina_Model_Categories     
     *
     **/

    public function setOrder($data)
    {
        $this->_Order=$data;
        return $this;
    }

    /**
     * gets column order type tinyint(1)
     * @return int     
     */
     
    public function getOrder()
    {
        return $this->_Order;
    }
    
    /**
     * returns the mapper class
     *
     * @return Vina_Model_CategoriesMapper
     *
     */

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Vina_Model_CategoriesMapper());
        }
        return $this->_mapper;
    }


    /**
     * deletes current row by deleting a row that matches the primary key
     * 
     * @return int
     */

    public function deleteRowByPrimaryKey()
    {
        if (!$this->getId())
            throw new Exception('Primary Key does not contain a value');
        return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());
    }

}

